<?php

namespace App\Http\Controllers\OA;

use App\Http\Controllers\Controller;
use App\Http\Controllers\Logic\ToolLogic;
use Illuminate\Http\Request;

/**
 * Class ToolLogic
 * @package App\Http\Controllers\OA
 * @desc 上传工具
 */
class ToolController extends Controller
{
    //上传用户图像
    public function uploadFile(Request $request)
    {
        //ret_json('err','err',$request->all());
        $rules = [
            'dir'=>'required|string',
        ];
        $this->verify($request->all(),$rules);
        try{
           $logic = new ToolLogic();
           $result = $logic->uploadFile($request);
           ret_json('ok','上传成功',$result);
        }catch(\Exception $e){
            ret_json('err',$e->getMessage());
        }
    }
}
